package cn.efunbox.afw.core.entity;

public class ApiCode extends AbstractApiCode {

    public final static int             _C_OK = 200 ;
    public final static ApiCode OK   = new ApiCode(null, _C_OK);

    public final static int             _C_NOT_FOUND = 404 ;
    public final static ApiCode NOT_FOUND   = new ApiCode("请求资源不存在", _C_NOT_FOUND);

    public final static int              _C_UNKNOWN_ERROR = 500;
    public final static ApiCode UNKNOWN_ERROR    = new ApiCode("服务端内部错误", _C_UNKNOWN_ERROR);

    public final static int              _C_SERVER_ERROR = 500;
    public final static ApiCode SERVER_ERROR    = new ApiCode("网络正忙,请稍后再试......", _C_SERVER_ERROR);

    public final static int             _C_PARAMETER_ERROR = 400;
    public final static ApiCode PARAMETER_ERROR    = new ApiCode("参数错误", _C_PARAMETER_ERROR);

    public final static int             _C_UNAUTHORIZED = 401;
    public final static ApiCode UNAUTHORIZED    = new ApiCode("未认证", _C_UNAUTHORIZED);

    public final static int             _C_INVALID_TOKEN = 402;
    public final static ApiCode INVALID_TOKEN    = new ApiCode("无效的Token", _C_INVALID_TOKEN);

    public final static int             _C_ACCESS_DENIED = 403;
    public final static ApiCode ACCESS_DENIED    = new ApiCode("访问被拒绝", _C_ACCESS_DENIED);

    public final static int             _C_SIGNATURE_ERROR = 510;
    public final static ApiCode SIGNATURE_ERROR    = new ApiCode("签名错误", _C_SIGNATURE_ERROR);

    public final static int             _C_API_UPGRADE = 520;
    public final static ApiCode API_UPGRADE    = new ApiCode("接口已升级", _C_API_UPGRADE);

    public final static int             _C_APPID_NOT_EXIST = 530;
    public final static ApiCode APPID_NOT_EXIST    = new ApiCode("应用id不存在", _C_APPID_NOT_EXIST);

    public final static int             _C_PARAMETER_INVALID = 540;
    public final static ApiCode PARAMETER_INVALID    = new ApiCode("参数验证不通过", _C_PARAMETER_INVALID);



    protected ApiCode(String message,int code) {
        super(code,message);
    }

    @Override
    public ApiCode setMessage(String message) {
        return (ApiCode)super.setMessage(message);
    }
}